package com.ma.Dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ma.entity.Student;
import com.ma.entity.Team;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
import java.util.Map;

/**
 * @ProjectName: project
 * @Package: com.ma.Dao
 * @ClassName: teamDao
 * @Author: YHHHH
 * @Description:
 * @Date: 2021/3/3 14:14
 * @Version: 1.0
 */
@Mapper
public interface teamDao{
    /*
    查看所有的小组
     */
//    @Select("select * from team")
//    @Results(id = "teamAll",value = {
//            @Result(id = true,property = "teamId",column = "id"),
//            @Result(property = "teamName",column = "name"),
//            @Result(property = "StudentId",column = "sid"),
//            @Result(property = "score",column = "score")
//    })
//    List<Map<String ,Object>> findAllTeam1();
    /*
    查询小组列表
     */
    List<Team> findAllTeam();
    /*
    加入小组
     */
    void joinTeam(@Param("teamId") Integer teamId, @Param("studentId") Integer studentId);

    /*
    新建小组
     */
    Integer addTeam(Team team);

    /*
    找到组长
     */
    String findLeader(@Param("teamID") Integer teamID);
    String findLeaderName(@Param("teamID") Integer teamID);
    /*
    找到该小组的详细信息
     */
    List<Team> findTeamData(@Param("teamId")Integer teamId);

    /*
    改小组项目号
     */
    Integer updateProject(@Param("teamId")Integer id,@Param("projectId")Integer pid);
    /*
    找到小组的项目号
     */
    Integer findProject(@Param("teamId")Integer teamId);
    /*
    给小组评分
     */
    Integer updateScore(@Param("score")Integer score,@Param("teamId")Integer teamId);
    /*
    修改小组全部成员的成绩
     */
    Integer updateStudentScore(@Param("teamId")Integer teamId);
}
